home *** CD-ROM | disk | FTP | other *** search
/ Delphi Informant Complete 1995 - 2000 / Delphi Informant Complete 1995 to 2000.iso / Delphi Informant Magazine Complete Works SOURCE CODE 1998.rar / 1998 / Apr / di9804bm / Notify_TLB.pas < prev    next >
Pascal/Delphi Source File  |  1997-12-15  |  2KB  |  89 lines

  1. unit Notify_TLB;
  2.  
  3. { This file contains pascal declarations imported from a type library.
  4.   This file will be written during each import or refresh of the type
  5.   library editor.  Changes to this file will be discarded during the
  6.   refresh process. }
  7.  
  8. { File Notification Server Library }
  9. { Version 1.0 }
  10.  
  11. interface
  12.  
  13. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;
  14.  
  15. const
  16.   LIBID_Notify: TGUID = '{64624091-5B32-11D1-8193-000000000000}';
  17.  
  18. const
  19.  
  20. { Component class GUIDs }
  21.   Class_Notify: TGUID = '{64624093-5B32-11D1-8193-000000000000}';
  22.  
  23. type
  24.  
  25. { Forward declarations: Interfaces }
  26.   INotify = interface;
  27.   INotifyDisp = dispinterface;
  28.   INotifier = interface;
  29.   INotifierDisp = dispinterface;
  30.  
  31. { Forward declarations: CoClasses }
  32.   Notify = INotify;
  33.  
  34. { Dispatch interface for Notify Object }
  35.  
  36.   INotify = interface(IDispatch)
  37.     ['{64624092-5B32-11D1-8193-000000000000}']
  38.     function Connect(const notifier: INotifier; const sDir: WideString; iMode: Integer; fSubTree: WordBool): Integer; safecall;
  39.     procedure Disconnect(hNotify: Integer); safecall;
  40.   end;
  41.  
  42. { DispInterface declaration for Dual Interface INotify }
  43.  
  44.   INotifyDisp = dispinterface
  45.     ['{64624092-5B32-11D1-8193-000000000000}']
  46.     function Connect(const notifier: INotifier; const sDir: WideString; iMode: Integer; fSubTree: WordBool): Integer; dispid 1;
  47.     procedure Disconnect(hNotify: Integer); dispid 2;
  48.   end;
  49.  
  50. { Event interface exported by server and implemented by client }
  51.  
  52.   INotifier = interface(IDispatch)
  53.     ['{64624094-5B32-11D1-8193-000000000000}']
  54.     procedure Change(const sDir: WideString; iMode: Integer; fSubTree: WordBool); safecall;
  55.   end;
  56.  
  57. { DispInterface declaration for Dual Interface INotifier }
  58.  
  59.   INotifierDisp = dispinterface
  60.     ['{64624094-5B32-11D1-8193-000000000000}']
  61.     procedure Change(const sDir: WideString; iMode: Integer; fSubTree: WordBool); dispid 1;
  62.   end;
  63.  
  64. { Coclass for Notify object }
  65.  
  66.   CoNotify = class
  67.     class function Create: INotify;
  68.     class function CreateRemote(const MachineName: string): INotify;
  69.   end;
  70.  
  71.  
  72.  
  73. implementation
  74.  
  75. uses ComObj;
  76.  
  77. class function CoNotify.Create: INotify;
  78. begin
  79.   Result := CreateComObject(Class_Notify) as INotify;
  80. end;
  81.  
  82. class function CoNotify.CreateRemote(const MachineName: string): INotify;
  83. begin
  84.   Result := CreateRemoteComObject(MachineName, Class_Notify) as INotify;
  85. end;
  86.  
  87.  
  88. end.
  89.